package com.mwm.loyal.libs.mq;

import org.springframework.stereotype.Component;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

@Component
public class TopicMessageListener implements MessageListener {

    @Override
    public void onMessage(Message message) {
        TextMessage ms = (TextMessage) message;
        try {
            System.out.println("topic---消息----" + ms.getText());
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}